﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NaturalNote.Core.Database
{
    internal class DbWrapper<T> where T : class, new()
    {
        private readonly TableInfo tableInfo;
        internal DbWrapper(DbTrait trait) {
            this.tableInfo = XTable<T>.Instance.TableInfo;
        }
        static readonly Dictionary<DbTrait, DbWrapper<T>> wrappers = new Dictionary<DbTrait, DbWrapper<T>>();
        internal static DbWrapper<T> Get(DbTrait trait, IDbConnection con)
        {
            if (!wrappers.ContainsKey(trait)) {
                wrappers[trait] = new DbWrapper<T>(trait);
            }
            return wrappers[trait];
        }

      
        internal void Save(T row)
        {
            
        }
        internal void Save(IEnumerable<T> rows)  
        {
            throw new NotImplementedException();
        }

        internal void Insert(T row) 
        {
            throw new NotImplementedException();
        }

        

        internal void Insert(IEnumerable<T> row)
        {
            throw new NotImplementedException();
        }
    }
}
